package com.cade.agriculturemall.view.home.promotion;

import com.avos.avoscloud.AVException;
import com.avos.avoscloud.AVQuery;
import com.avos.avoscloud.FindCallback;
import com.cade.agriculturemall.base.BasePresenter;
import com.cade.agriculturemall.base.IBasePresenter;
import com.cade.agriculturemall.base.IBaseView;
import com.cade.agriculturemall.model.GoodsDetailEntity;

import java.util.List;

/**
 * Created by Administrator on 2018/4/28 0028.
 */

public class PromotionPresenter extends BasePresenter<PromotionContract.IView> implements PromotionContract.IPresenter {

    public PromotionPresenter(PromotionContract.IView view) {
        super(view);
    }

    @Override
    public void onResume() {

    }

    @Override
    public void onCreate() {

    }

    @Override
    public void onDestroy() {

    }

    @Override
    public void downLoadList() {
        AVQuery<GoodsDetailEntity> avQuery = new AVQuery<>("ClassifyGoodsThird");
        avQuery.whereEqualTo("parentId", "5a15222f570c352622aee1bc");
        avQuery.orderByDescending("sell_offs");
        avQuery.findInBackground(new FindCallback<GoodsDetailEntity>() {
            @Override
            public void done(List<GoodsDetailEntity> list, AVException e) {
                if (list.size() != 0) {
mView.getList(list);
                } else {
                }
            }
        });
    }
}
